<#import "/spring.ftl" as spring/>
<#import "/common/base.ftl" as base/>
<@base.page '供应商'>

<div class="row" ng-controller="supplierIndexController">
    <div class="col-lg-12">
        <div class="ibox float-e-margins">
          	<div class="filterItems">
				    <form class="form-inline" onsubmit="return false;">
				      <div class="form-group">
				        <label for="supplierCode">编码:</label>
				        <input type="text" class="form-control round-border" ng-model="supplierCode" name="supplierCode" placeholder="">
				      </div>
				      <div class="form-group">
				        <label for="supplierName">名称:</label>
				        <input type="text" class="form-control round-border" ng-model="supplierName" name="supplierName" placeholder="">
				      </div>
				      <label for="settmentType">结算方式</label>
				      <select ng-model="settmentType" name="settmentType" class="form-control"  ng-options="orderType.key as orderType.value for orderType in orderTypes">
				      <option value="">-- 请选择 --</option>
				      </select>

		 		      <button class="btn btn-primary" ng-click="Search()">查询</button>
				      					      
				      <button class="btn btn-primary" ng-click="Reset()">重置</button>
				    </form>
          	</div>
           <br>
           	<button class="btn btn-primary" ng-click="Add()">新增</button>
	
			<button class="btn btn-primary" ng-click="Export()">导出</button>
				      <br><br>
            <div class="ibox-content">
            	
            	<div class="tabs">
	            	<ul class="nav nav-tabs">
					  <li id="Using" role="presentation" class="active"><a ng-click="TabClick('Using',1)" style="cursor:pointer">使用中</a></li>
					  <li id="NoUsed" role="presentation"><a ng-click="TabClick('NoUsed',0)" style="cursor:pointer">已停用</a></li>
					  <li id="All" role="presentation"><a ng-click="TabClick('All',-1)" style="cursor:pointer">全部</a></li>
					</ul>
            	</div>
			  <div class="tab-content"> 
			   <div class="tab-pane active"> 
			    <table class="table table-striped table-hover dataTables-example dataTable" style="width:100%"> 
				        <thead>
				            <tr>
				                <th style="text-align:center;" width:"5%">编码</th>
				                <th style="text-align:center;" width:"15%">名称</th>
				                <th style="text-align:center;" width:"5%">结算方式</th>
				               	<th style="text-align:center;" width:"5%">发票类型</th>
				                <th style="text-align:center;" width:"10%">供应商类型</th>
				                <th style="text-align:center;" width:"10%">商品类目</th>
				                <th style="text-align:center;" width:"10%">联系人</th>
				                <th style="text-align:center;" width:"10%">联系电话</th>
				                <th style="text-align:center;" width:"5%">使用状态</th>
				                
				                <th style="text-align:center" width:"15%">操作</th>
				            </tr>
				        </thead>
				  <tbody> 
			      <tr class="ng-scope" ng-repeat="supplier in supplierList "> 
			       <td class="text-center" style="text-decoration:underline"><a href="#" ng-click="Detail(supplier.id)">{{supplier.supplierCode}}</a></td> 
			       <td class="text-center">{{supplier.supplierName}}</td>
			       <td class="text-center">{{supplier.settmentTypeStr}}</td>
					<td class="text-center">{{supplier.invoiceTypeStr}}</td>
			       <td class="text-center">{{supplier.supplierTypeStr}}</td>
			       <td class="text-center">{{supplier.goodsClass}}</td>
			       <td class="text-center">{{supplier.contractPerson}}</td>
			       <td class="text-center">{{supplier.contractMobile}}</td>
			       <td class="text-center">{{supplier.isUseStr}}</td>
			      
			       <td class="text-center">
			         <a style="cursor:pointer;" ng-click="Edit(supplier.id);">编辑</a> 
					 <a style="cursor:pointer;" ng-if="supplier.isUse==0" ng-click="use(supplier.id,1);">启用</a>
					 <a style="cursor:pointer;" ng-if="supplier.isUse==1" ng-click="use(supplier.id,0);">停用</a>

					 <a style="cursor:pointer;"  ng-click="goodsMaintain(supplier.id,supplier.supplierName);">商品维护</a>
					 
			       </td> 
			      </tr> 
			      <tr> 
			       <td colspan="16" class="text-center"> 
			        <nav>
			         <span style="margin-top :-10px;  position: absolute;width:100%;left:5%">
						<ul class="pagination" style="height:10px">
						<li>
							<a href="#" aria-label="Previous" ng-click="GotoPage(CurrentPage-1)"><span aria-hidden="true">上一页</span></a>
						</li>
						<li ng-click="GotoPage(page)" href="#" ng-repeat="page in ShowPages">
							<a href="#">{{page}}</a>
						</li>
						<li>
							<a href="#" aria-label="Next" ng-click="GotoPage(CurrentPage+1)"><span aria-hidden="true">下一页</span></a>
						</li>
						</ul>
						<b><span style="padding: 30px 19px 14px 20px;top :-13px;position: relative;">第 {{CurrentPage}} 页 {{RecordCount}} 条</span></b>
					</span>
					</nav>
			       </td> 
			      </tr> 
			     </tbody> 
				    </table>
                    </div>  
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<@spring.url '/assets/pagejs/supplier/supplier.js' />"></script>
</@base.page >

